package com.hrt.datasender.web.monitordata;

import com.btcode.common.PropertiesUnit;

public class MonitorWaterType {

    // 0污水 1地表水 3供水 2工业废水 4工业废气
    public MonitorDataType getWaterType(String waterType, String tableType) {
        // 获取是否使用分表配置
        String monitorWatertype = PropertiesUnit.getValue("monitorWatertype");
        MonitorDataType md = MonitorDataType.day;
        if ("true".equals(monitorWatertype)) {
            if (waterType.equals("0")) {
                if (tableType.equals("second")) {
                    md = MonitorDataType.szws_second;
                } 
                else if (tableType.equals("minute")) {
                    md = MonitorDataType.szws_minute;
                }
                else if (tableType.equals("hour")) {
                    md = MonitorDataType.szws_hour;
                } 
                else if (tableType.equals("day")) {
                    md = MonitorDataType.szws_day;
                }
                else if (tableType.equals("week")) {
                    md = MonitorDataType.szws_week;
                }
                else if (tableType.equals("month")) {
                    md = MonitorDataType.szws_month;
                }
                else if (tableType.equals("quarter")) {
                    md = MonitorDataType.szws_quarter;
                }
                else if (tableType.equals("year")) {
                    md = MonitorDataType.szws_year;
                } 
                else if (tableType.equals("cycle")) {
                    md = MonitorDataType.szws_cycle;
                } 
                else {

                }
            } 
            else if (waterType.equals("1")) {
                if (tableType.equals("second")) {
                    md = MonitorDataType.szsw_second;
                } 
                else if (tableType.equals("minute")) {
                    md = MonitorDataType.szsw_minute;
                }
                else if (tableType.equals("hour")) {
                    md = MonitorDataType.szsw_hour;
                }
                else if (tableType.equals("day")) {
                    md = MonitorDataType.szsw_day;
                } 
                else if (tableType.equals("week")) {
                    md = MonitorDataType.szsw_week;
                }
                else if (tableType.equals("month")) {
                    md = MonitorDataType.szsw_month;
                }
                else if (tableType.equals("quarter")) {
                    md = MonitorDataType.szsw_quarter;
                }
                else if (tableType.equals("year")) {
                    md = MonitorDataType.szsw_year;
                } 
                else if (tableType.equals("cycle")) {
                    md = MonitorDataType.szsw_cycle;
                }
                else {

                }
            }
            else if (waterType.equals("2")) {
                if (tableType.equals("second")) {
                    md = MonitorDataType.szgyfs_second;
                } 
                else if (tableType.equals("minute")) {
                    md = MonitorDataType.szgyfs_minute;
                }
                else if (tableType.equals("hour")) {
                    md = MonitorDataType.szgyfs_hour;
                } 
                else if (tableType.equals("day")) {
                    md = MonitorDataType.szgyfs_day;
                } 
                else if (tableType.equals("week")) {
                    md = MonitorDataType.szgyfs_week;
                }
                else if (tableType.equals("month")) {
                    md = MonitorDataType.szgyfs_month;
                }
                else if (tableType.equals("quarter")) {
                    md = MonitorDataType.szgyfs_quarter;
                } 
                else if (tableType.equals("year")) {
                    md = MonitorDataType.szgyfs_year;
                } 
                else if (tableType.equals("cycle")) {
                    md = MonitorDataType.szgyfs_cycle;
                } 
                else {

                }
            }
            else if (waterType.equals("3")) {
                if (tableType.equals("second")) {
                    md = MonitorDataType.szgs_second;
                } 
                else if (tableType.equals("minute")) {
                    md = MonitorDataType.szgs_minute;
                } 
                else if (tableType.equals("hour")) {
                    md = MonitorDataType.szgs_hour;
                } 
                else if (tableType.equals("day")) {
                    md = MonitorDataType.szgs_day;
                } 
                else if (tableType.equals("week")) {
                    md = MonitorDataType.szgs_week;
                } 
                else if (tableType.equals("month")) {
                    md = MonitorDataType.szgs_month;
                } 
                else if (tableType.equals("quarter")) {
                    md = MonitorDataType.szgs_quarter;
                } 
                else if (tableType.equals("year")) {
                    md = MonitorDataType.szgs_year;
                }
                else if (tableType.equals("cycle")) {
                    md = MonitorDataType.szgs_cycle;
                }
                else {

                }
            } 
            else if (waterType.equals("4")) {
                if (tableType.equals("second")) {
                    md = MonitorDataType.szgyfq_second;
                } 
                else if (tableType.equals("minute")) {
                    md = MonitorDataType.szgyfq_minute;
                } 
                else if (tableType.equals("hour")) {
                    md = MonitorDataType.szgyfq_hour;
                } 
                else if (tableType.equals("day")) {
                    md = MonitorDataType.szgyfq_day;
                } 
                else if (tableType.equals("week")) {
                    md = MonitorDataType.szgyfq_week;
                } 
                else if (tableType.equals("month")) {
                    md = MonitorDataType.szgyfq_month;
                } 
                else if (tableType.equals("quarter")) {
                    md = MonitorDataType.szgyfq_quarter;
                }
                else if (tableType.equals("year")) {
                    md = MonitorDataType.szgyfq_year;
                } 
                else if (tableType.equals("cycle")) {
                    md = MonitorDataType.szgyfq_cycle;
                } 
                else {

                }
            }

        } 
        else {

            if (tableType.equals("second")) {
                md = MonitorDataType.second;
            } 
            else if (tableType.equals("minute")) {
                md = MonitorDataType.minute;
            } 
            else if (tableType.equals("hour")) {
                md = MonitorDataType.hour;
            } 
            else if (tableType.equals("day")) {
                md = MonitorDataType.day;
            }
            else if (tableType.equals("week")) {
                md = MonitorDataType.Week;
            }
            else if (tableType.equals("month")) {
                md = MonitorDataType.month;
            }
            else if (tableType.equals("quarter")) {
                md = MonitorDataType.quarter;
            } 
            else if (tableType.equals("year")) {
                md = MonitorDataType.year;
            }
            else if (tableType.equals("cycle")) {
                md = MonitorDataType.cycle;
            }
            else {

            }
        }
        return md;

    }
}
